<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册 - SocialApp</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', sans-serif;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: #f0f2f5;
        }

        .register-container {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 15px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 450px;
            padding: 35px 40px;
        }

        .register-title {
            text-align: center;
            margin-bottom: 30px;
        }

        .register-title h1 {
            color: #1a73e8;
            font-size: 2.2rem;
            margin-bottom: 8px;
        }

        .register-title p {
            color: #5f6368;
            font-size: 1.1rem;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            color: #333;
            font-size: 0.95rem;
            margin-bottom: 8px;
        }

        .form-group input,
        .form-group select {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #dfe1e5;
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.3s;
        }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #1a73e8;
            box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
        }

        .error-message {
            color: #db4437;
            font-size: 0.9rem;
            margin-top: 5px;
            display: none;
        }

        .form-group.error .error-message {
            display: block;
        }

        .register-btn {
            width: 100%;
            padding: 14px;
            background: #1a73e8;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.3s;
        }

        .register-btn:hover {
            background: #1557b3;
        }

        .social-links {
            margin-top: 30px;
            text-align: center;
        }

        .social-links p {
            color: #5f6368;
            margin-bottom: 15px;
        }

        .social-buttons {
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        .social-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 1px solid #dfe1e5;
            color: #666;
            font-size: 1.4rem;
            transition: all 0.3s;
        }

        .social-btn:hover {
            background: #f0f2f5;
            color: #1a73e8;
        }

        .login-link {
            text-align: center;
            margin-top: 25px;
            font-size: 0.95rem;
        }

        .login-link a {
            color: #1a73e8;
            text-decoration: none;
            font-weight: 500;
        }

        .login-link a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="register-container">
        <div class="register-title">
            <h1>注册新账号</h1>
            <p>简单几步开启社交之旅</p>
        </div>

        <c:if test="${param.error != null}">
            <div class="error-message" style="text-align: center; margin-bottom: 20px; color: #ff4444;">
                用户名已存在，请更换其他用户名
            </div>
        </c:if>

        <form action="register" method="post" class="register-form">
            <div class="form-group">
                <label for="nickname">用户名</label>
                <input type="text" id="nickname" name="nickname" required>
            </div>

            <div class="form-group">
                <label for="phone">手机号</label>
                <input type="text" id="phone" name="phone" required>
            </div>

            <div class="form-group">
                <label for="email">电子邮箱</label>
                <input type="email" id="email" name="email" required>
            </div>

            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" required>
            </div>

            <div class="form-group">
                <label for="avatar">头像链接（可选）</label>
                <input type="text" id="avatar" name="avatar">
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
                <div class="form-group">
                    <label for="birthdate">出生日期</label>
                    <input type="date" id="birthdate" name="birthdate">
                </div>

                <div class="form-group">
                    <label for="gender">性别</label>
                    <select id="gender" name="gender" required>
                        <option value="male">男</option>
                        <option value="female">女</option>
                        <option value="other">其他</option>
                    </select>
                </div>
            </div>

            <button type="submit" class="register-btn">立即注册</button>
        </form>

        <div class="social-links">
            <p>或通过社交账号注册</p>
            <div class="social-buttons">
                <a href="#" class="social-btn"><i class="fab fa-google"></i></a>
                <a href="#" class="social-btn"><i class="fab fa-facebook-f"></i></a>
                <a href="#" class="social-btn"><i class="fab fa-twitter"></i></a>
            </div>
        </div>

        <div class="login-link">
            <p>已有账号？<a href="login.jsp">立即登录</a></p>
        </div>
    </div>

    <!-- 引入Font Awesome图标库 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/js/all.min.js"></script>
</body>
</html>